<template>
   <div style="height: 100%; position: relative">
        <div style="position: relative">
            <el-tabs v-model="activeName" @tab-click="handleClick">
                <el-tab-pane
                    :key="item.name"
                    v-for="item in tabs"
                    :label="item.label"
                    :name="item.name"
                >
                </el-tab-pane>
            </el-tabs>
        </div>
        <router-view></router-view>
    </div>
</template>
<script>
    export default {
        data() {
            return {
            activeName: this.$route.name,
            tabs: [
                {"label": "回厂统计", "name": 'transaction-statistics'},
				{"label": "成交统计", "name": 'returning-statistics'},
            ],
             };
           
        },
        components: {
        },
        created() { 
        },
        mounted() {
           
        },
        watch: {
            $route(to, from) {
                this.activeName = this.$route.name;
            }
            },
        methods: {
            handleClick(tab, event) {
            this.activeName = tab.name;
                if(tab.index==0){
                    this.$router.push({name:'transaction-statistics'})
                }else if(tab.index==1){
                    this.$router.push({name:'returning-statistics'})
                } 
            }
	          
        }
     
    };
</script>
<style lang="scss" scoped>
    .sign-up-info {
        .search-content {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            &-input {
                width: 200px;
            }
            .time-range-wrapper {
                .time-range-label {
                    font-size: 14px;
                }
                display: flex;
                align-items: center;
                /deep/.el-range-separator {
                    box-sizing: content-box;
                }
            }
        }
        .bottom {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
    }

    .titlecon {
        font-size: 16px;
        font-weight: bold;
        padding-bottom: 10px;
    }

    .btn-bottom {
        background: #409eff;
        color: #fff;
        border: 0;
        font-size: 14px;
        padding: 5px 8px;
        border-radius: 3px;
        display: inline-block;
    }

    .span-title {
        font-size: 14px;
        color: rgb(46, 45, 45);
    }

    .downloadflag {
        font-weight: normal;
        position: absolute;
        right: 0;
        float: right;
        cursor: pointer;
        color: skyblue;
    }

    .nocenter {
        text-align: center;
        line-height: 60px;
        color: #909399;
        font-size: 12px;
        margin-top: 100px;
    }
</style>